home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows3 / mdit.zip / MDIT_SRC.ZIP / FRAME.C < prev    next >
C/C++ Source or Header  |  1992-03-31  |  17KB  |  562 lines

  1. /****************************************************************************
  2. Module name: MDIT.C
  3. Programmer : Jeffrey M. Richter & Elvira Peretsman.
  4. Modified   : V. M. Vanderburg & M.T. Peterson, TriTechnologies
  5.                    -    Converted to multithreading
  6.                    -    Removed original comments
  7.  
  8. ATTRIBUTIONS:
  9.  
  10.     With the exception of the PCthread calls, this code was taken directly
  11.     from the source disk furnished with the Windows Developer's Guide,
  12.     M&T Press, by Jeffrey M. Richter.  I highly recommend Mr. Richter's
  13.     book both for its readability and the structure and quality of the
  14.     code.
  15. *****************************************************************************/
  16.  
  17. /*
  18. #include "..\nowindws.h"
  19. #undef NOCOLOR
  20. #undef NOCTLMGR
  21. #undef NODEFERWINDOWPOS
  22. #undef NOGDI
  23. #undef NOKERNEL
  24. #undef NOLSTRING
  25. #undef NOMB
  26. #undef NOMDI
  27. #undef NOMENUS
  28. #undef NOMINMAX
  29. #undef NONCMESSAGES
  30. #undef NOSCROLL
  31. #undef NOSHOWWINDOW
  32. #undef NOSYSCOMMANDS
  33. #undef NOSYSMETRICS
  34. #undef NOTEXTMETRIC
  35. #undef NOUSER
  36. #undef NOWH
  37. #undef NOWINMESSAGES
  38. #undef NOWINOFFSETS
  39. #undef NOWINSTYLES
  40. #define OEMRESOURCE
  41. */
  42. #include <windows.h>
  43. #define OBM_CLOSE           32754    /* don't know why this is needed */
  44.  
  45. #include "mdit.h"    /* includes pcthread.h */
  46.  
  47. extern th_list_p_t g_th_list_p;
  48.  
  49. static char _szClassName[] = "Frame";
  50.  
  51. typedef struct {
  52.    WORD  wNumThreads;   // Number of Thread windows created.
  53.    HMENU hMenu;         // Menu used when no MDIT Children are active.
  54.    BOOL  fStatusBarOn;  // Is the status bar showing.
  55.    HWND  hWndMenuHelp;  // Window that last received a WM_MENUSELECT message.
  56.    DWORD dwMenuHelp;    // Menu help code placed here by hWndMenuHelp window.
  57. } CLSEB;
  58.  
  59. void NEAR PASCAL TileVertically (HWND hWndMDITClient);
  60. BOOL FAR PASCAL AboutProc (HWND hDlg, WORD wMsg, WORD wParam, LONG lParam);
  61.  
  62. LONG FAR PASCAL FrameWndProc (HWND hWnd, WORD wMsg, WORD wParam, LONG lParam)
  63. {
  64.    BOOL fCallDefProc = FALSE;
  65.    DWORD dwResult = 0;
  66.    CLIENTCREATESTRUCT ccs;
  67.    HMENU hMenu;
  68.    RECT rc, rcTemp;
  69.    WORD wTemp = 0;
  70.    FARPROC fpProc;
  71.    char szBuf[100];
  72.    PAINTSTRUCT ps;
  73.    TEXTMETRIC tm;
  74.    HPEN hPen;
  75.    BITMAP Bitmap;
  76.    HWND hWndActiveMDITChild, hWndChild;
  77.    BOOL fMDITChildIsMaximized;
  78.    th_list_p_t cur_p;
  79.    th_list_p_t next_p;
  80.  
  81.    if (IsWindow(g_hWndMDITClient))
  82.       dwResult = SendMessage(g_hWndMDITClient, WM_MDIGETACTIVE, 0, 0);
  83.    
  84.    hWndActiveMDITChild = (HWND) LOWORD(dwResult);
  85.    
  86.    fMDITChildIsMaximized = HIWORD(dwResult);
  87.    dwResult = 0;
  88.  
  89.    switch (wMsg) 
  90.    {
  91.       case WM_CREATE:
  92.          
  93.          hMenu = LoadMenu(g_hInstance, _szClassName);
  94.          SETCLSEB(hWnd, CLSEB, hMenu, hMenu);
  95.          SETCLSEB(hWnd, CLSEB, fStatusBarOn, TRUE);
  96.  
  97.          
  98.          ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd), 1);
  99.          ccs.idFirstChild = IDM_WINDOWCHILD;
  100.  
  101.          g_hWndMDITClient = CreateWindow("MDIClient", "",
  102.             WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL |
  103.             WS_VISIBLE | WS_CLIPSIBLINGS, 0, 0, 0, 0, hWnd, NULL, g_hInstance,
  104.             (LPSTR) (LPCLIENTCREATESTRUCT) &ccs);
  105.          break;
  106.  
  107.       case WM_CLOSE:
  108.          
  109.          fCallDefProc = TRUE;
  110.          SendMessage(hWnd, WM_ENDSESSION, TRUE, 0);
  111.          break;
  112.  
  113.       case WM_QUERYENDSESSION:
  114.          
  115.          dwResult = TRUE;
  116.          break;
  117.  
  118.       case WM_ENDSESSION:
  119.          
  120.          hWndChild = GetWindow(g_hWndMDITClient, GW_CHILD);
  121.  
  122.          if (hWndChild == NULL) 
  123.               break;
  124.          
  125.          do 
  126.          {
  127.             if (GetWindow(hWndChild, GW_OWNER) != NULL) continue;
  128.  
  129.             SendMessage(hWndChild, WM_ENDSESSION, wParam, 0);
  130.          } while ((hWndChild = GetWindow(hWndChild, GW_HWNDNEXT)) != NULL);
  131.          break;
  132.  
  133.       case WM_DESTROY:
  134.          PostQuitMessage(0);
  135.          break;
  136.  
  137.       case WM_SYSCOMMAND:
  138.          
  139.          SetFocus(hWnd); 
  140.          fCallDefProc = TRUE;
  141.          break;
  142.  
  143.       case WM_NCLBUTTONDBLCLK:
  144.          
  145.          fCallDefProc = TRUE;
  146.  
  147.          if (wParam != HTMENU) 
  148.               break;
  149.  
  150.          dwResult = SendMessage(g_hWndMDITClient, WM_MDIGETACTIVE, 0, 0);
  151.          if (HIWORD(dwResult) != 1) 
  152.               break;
  153.  
  154.          GetWindowRect(hWnd, &rc);
  155.          
  156.          wTemp = LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CLOSE));
  157.  
  158.          GetObject((HBITMAP) wTemp, sizeof(BITMAP), (LPSTR) (LPBITMAP) &Bitmap);
  159.          DeleteObject((HBITMAP) wTemp);
  160.          
  161.          rc.top += GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYFRAME);
  162.          rc.bottom =  rc.top + Bitmap.bmHeight;
  163.          rc.left += GetSystemMetrics(SM_CXFRAME);
  164.          rc.right = rc.left + Bitmap.bmWidth / 2;
  165.          
  166.          if (!PtInRect(&rc, MAKEPOINT(lParam))) 
  167.               break;
  168.  
  169.          SendMessage(LOWORD(dwResult), WM_SYSCOMMAND, SC_CLOSE, lParam);
  170.          fCallDefProc = FALSE;
  171.          break;
  172.  
  173.       case FW_MDITCHILDDESTROY:
  174.          
  175.          if (hWndActiveMDITChild != NULL) 
  176.               break;
  177.          
  178.          ChangeMDITMenu(hWnd, g_hWndMDITClient,
  179.             (HMENU) GETCLSEB(hWnd, CLSEB, hMenu), IDM_WINDOWTILEVERT);
  180.  
  181.          g_hAccelTable = NULL;
  182.          
  183.          InvalidateRect(hWnd, NULL, TRUE);
  184.  
  185.          break;
  186.  
  187.       case FW_GETSTATBARRECT:
  188.          
  189.          GetClientRect(hWnd, (LPRECT) lParam);
  190.  
  191.          if (!GETCLSEB(hWnd, CLSEB, fStatusBarOn)) 
  192.          {
  193.             ((LPRECT) lParam)->top = ((LPRECT) lParam)->bottom;
  194.             break;
  195.          }
  196.          
  197.          wTemp = GetDC(hWnd);
  198.          GetTextMetrics((HDC) wTemp, &tm);
  199.          ReleaseDC(hWnd, (HDC) wTemp);
  200.          ((LPRECT) lParam)->top = 
  201.                 ((LPRECT) lParam)->bottom - 
  202.                         tm.tmHeight - GetSystemMetrics(SM_CYBORDER);
  203.          break;
  204.  
  205.       case FW_DRAWSTATUSDIVIDE:
  206.          
  207.          dwResult = GetSystemMetrics(SM_CYBORDER);
  208.          hPen = CreatePen(PS_SOLID, (int) dwResult, RGB(0, 0, 0));
  209.          hPen = SelectObject(((LPPAINTSTRUCT) lParam)->hdc, hPen);
  210.          MoveTo(((LPPAINTSTRUCT) lParam)->hdc, 0,
  211.             ((LPPAINTSTRUCT) lParam)->rcPaint.top);
  212.          LineTo(((LPPAINTSTRUCT) lParam)->hdc, 
  213.             ((LPPAINTSTRUCT) lParam)->rcPaint.right, 
  214.             ((LPPAINTSTRUCT) lParam)->rcPaint.top);
  215.          hPen = SelectObject(((LPPAINTSTRUCT) lParam)->hdc, hPen);
  216.          DeleteObject(hPen);
  217.          break;
  218.  
  219.       case FW_RESIZEMDITCLIENT:
  220.          
  221.          GetClientRect(hWnd, &rc);
  222.          
  223.          SendMessage(hWnd, FW_GETSTATBARRECT, 0, (LONG) (LPRECT) &rcTemp);
  224.          rc.bottom -= rcTemp.bottom - rcTemp.top;
  225.          MoveWindow(g_hWndMDITClient, 0, rc.top, rc.right, rc.bottom, TRUE);
  226.          break;
  227.  
  228.       case WM_SIZE:
  229.          
  230.          SendMessage(hWnd, FW_RESIZEMDITCLIENT, 0, 0);
  231.          break;
  232.  
  233.       case WM_PAINT:
  234.          
  235.          BeginPaint(hWnd, &ps);
  236.          SendMessage(hWnd, FW_GETSTATBARRECT, 0, (LONG) (LPRECT) &ps.rcPaint);
  237.          SetBkMode(ps.hdc, TRANSPARENT);
  238.          
  239.          if (hWndActiveMDITChild) 
  240.          {
  241.             SendMessage(hWndActiveMDITChild, AC_PAINTSTATBAR, ps.hdc,
  242.                (LONG) (LPPAINTSTRUCT) &ps);
  243.          } 
  244.          else 
  245.          {
  246.             ps.rcPaint.top += (int) SendMessage(hWnd, FW_DRAWSTATUSDIVIDE, 0,
  247.                (LONG) (LPPAINTSTRUCT) &ps);
  248.             LoadString(g_hInstance, IDS_FRAMESTATUSBAR, szBuf, sizeof(szBuf));
  249.             TextOut(ps.hdc, 0, ps.rcPaint.top, szBuf, lstrlen(szBuf));
  250.          }
  251.  
  252.          EndPaint(hWnd, &ps);
  253.          break;
  254.  
  255.       case WM_INITMENU:
  256.          
  257.          CheckMenuItem(wParam, IDM_OPTIONSSTATUS, MF_BYCOMMAND |
  258.             (GETCLSEB(hWnd, CLSEB, fStatusBarOn) ? MF_CHECKED : MF_UNCHECKED));
  259.  
  260.          break;
  261.  
  262.       case FW_SETMENUHELP:
  263.          
  264.          SETCLSEB(hWnd, CLSEB, hWndMenuHelp, (HWND) wParam);
  265.          SETCLSEB(hWnd, CLSEB, dwMenuHelp, lParam);
  266.  
  267.          if (wParam == NULL) 
  268.          {
  269.             SendMessage(hWnd, FW_GETSTATBARRECT, 0, (LONG) (LPRECT) &rc);
  270.             
  271.             InvalidateRect(hWnd, &rc, TRUE);
  272.          }
  273.          break;
  274.  
  275.       case FW_GETMENUHELP:
  276.          
  277.          dwResult = GETCLSEB(hWnd, CLSEB, dwMenuHelp);
  278.          break;
  279.  
  280.       case WM_MENUSELECT:
  281.  
  282.          if (lParam == MAKELONG(-1, 0)) 
  283.          {
  284.             SendMessage(hWnd, FW_SETMENUHELP, 0, 0);
  285.             break;
  286.          }
  287.          
  288.          wTemp = 0;
  289.  
  290.          switch (LOWORD(lParam) & (MF_POPUP | MF_SYSMENU)) 
  291.          {
  292.             case 0:
  293.  
  294.                if (hWndActiveMDITChild != NULL)  
  295.                {
  296.                   if (fMDITChildIsMaximized) 
  297.                   {
  298.                      wTemp = GetSubMenu(GetMenu(hWnd), 0);
  299.                      if ((int) GetMenuState(wTemp, wParam, MF_BYCOMMAND) != -1)
  300.                         lParam |= MF_SYSMENU;
  301.                   }
  302.                   
  303.                   SendMessage(hWndActiveMDITChild, wMsg, wParam, lParam);
  304.                   wTemp = 0;  
  305.                   break;
  306.                }
  307.  
  308.                wTemp = IDS_FRAMEMENUID + wParam;
  309.                break;
  310.  
  311.             case MF_POPUP:
  312.  
  313.                if (hWndActiveMDITChild != NULL) 
  314.                {
  315.                   if (fMDITChildIsMaximized) 
  316.                   {
  317.                      if (wParam == GetSubMenu(GetMenu(hWnd), 0))
  318.                         lParam |= MF_SYSMENU;
  319.                   }
  320.                   
  321.                   SendMessage(hWndActiveMDITChild, wMsg, wParam, lParam);
  322.                   wTemp = 0;  
  323.                   break;
  324.                }
  325.                
  326.                hMenu = GetMenu(hWnd);
  327.                wTemp = GetMenuItemCount(hMenu);
  328.                while (wTemp--) 
  329.                   if (GetSubMenu(hMenu, wTemp) == (HMENU) wParam) break;
  330.  
  331.                wTemp += IDS_FRAMEPOPUPID + 1;   
  332.                break;
  333.  
  334.             case MF_SYSMENU:
  335.                
  336.                wTemp = IDS_FRAMEMENUID + ((wParam & 0x0FFF) >> 4);
  337.                break;
  338.  
  339.             case MF_POPUP | MF_SYSMENU:
  340.                
  341.                wTemp = IDS_FRAMEPOPUPID;
  342.                break;
  343.          }
  344.  
  345.          if (wTemp == 0) break;
  346.  
  347.          SendMessage(hWnd, FW_SETMENUHELP, hWnd, wTemp);
  348.          break;
  349.  
  350.       case WM_ENTERIDLE:
  351.          if (wParam != MSGF_MENU) 
  352.               break;
  353.          
  354.          if (GETCLSEB(hWnd, CLSEB, hWndMenuHelp) == -1)
  355.               break;
  356.          
  357.          SendMessage(hWnd, FW_GETSTATBARRECT, 0, (LONG) (LPRECT) &rc);
  358.          InvalidateRect(hWnd, &rc, TRUE);
  359.  
  360.          BeginPaint(hWnd, &ps);
  361.  
  362.          SetBkMode(ps.hdc, TRANSPARENT);
  363.          
  364.          SendMessage((HWND) GETCLSEB(hWnd, CLSEB, hWndMenuHelp),
  365.             AW_PAINTMENUHELP, 0, (LONG) (LPPAINTSTRUCT) &ps);
  366.  
  367.          EndPaint(hWnd, &ps);
  368.  
  369.          SETCLSEB(hWnd, CLSEB, hWndMenuHelp, (HWND) -1);
  370.          break;
  371.  
  372.       case AW_PAINTMENUHELP:
  373.          
  374.          dwResult = SendMessage(hWnd, FW_GETMENUHELP, 0, 0);
  375.  
  376.          ((LPPAINTSTRUCT) lParam)->rcPaint.top += (int) 
  377.             SendMessage(hWnd, FW_DRAWSTATUSDIVIDE, 0,
  378.             (LONG) (LPPAINTSTRUCT) lParam);
  379.  
  380.          LoadString(g_hInstance, LOWORD(dwResult), szBuf, sizeof(szBuf));
  381.          
  382.          TextOut(((LPPAINTSTRUCT) lParam)->hdc,
  383.             0, ((LPPAINTSTRUCT) lParam)->rcPaint.top, szBuf, lstrlen(szBuf));
  384.          break;
  385.  
  386.       case WM_COMMAND:
  387.  
  388.          if (wParam >= IDM_WINDOWCHILD) 
  389.          {
  390.             fCallDefProc = TRUE;
  391.             break;
  392.          }
  393.  
  394.          switch (wParam) 
  395.          {
  396.             case IDM_FILEOPENTHREAD:
  397.                wTemp = GETCLSEB(hWnd, CLSEB, wNumThreads) + 1;
  398.                SETCLSEB(hWnd, CLSEB, wNumThreads, wTemp);
  399.  
  400.                wsprintf(szBuf, "Thread%d", wTemp);
  401.  
  402.                CreateMDITChild("Thread", szBuf, 0,
  403.                   CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
  404.                   g_hWndMDITClient, g_hInstance, 0);
  405.  
  406.                break;
  407.  
  408.             case IDM_OPTIONSSTATUS:
  409.  
  410.                wTemp = !GETCLSEB(hWnd, CLSEB, fStatusBarOn);
  411.                SETCLSEB(hWnd, CLSEB, fStatusBarOn, wTemp);
  412.                SendMessage(hWnd, FW_RESIZEMDITCLIENT, 0, 0);
  413.                break;
  414.  
  415.             case IDM_EXIT:
  416.                SendMessage(hWnd, WM_CLOSE, 0, 0L);
  417.                break;
  418.  
  419.             case IDM_HELPINDEX:
  420.             case IDM_HELPKEYBOARD:
  421.             case IDM_HELPCOMMANDS:
  422.             case IDM_HELPPROCEDURES:
  423.             case IDM_HELPUSINGHELP:
  424.                MessageBox(hWnd, "Option not implemented.", g_szAppName, MB_OK);
  425.                break;
  426.  
  427.             case IDM_ABOUT:
  428.                fpProc = MakeProcInstance(AboutProc, g_hInstance);
  429.                DialogBox(g_hInstance, "About", hWnd, fpProc);
  430.                FreeProcInstance(fpProc);
  431.                break;
  432.  
  433.             case IDM_WINDOWTILEVERT:
  434.                
  435.                TileVertically(g_hWndMDITClient);
  436.                break;
  437.  
  438.             case IDM_WINDOWTILEHORIZ:
  439.                
  440.                SendMessage(g_hWndMDITClient, WM_MDITILE, 0, 0);
  441.                break;
  442.  
  443.             case IDM_WINDOWCASCADE:
  444.                
  445.                SendMessage(g_hWndMDITClient, WM_MDICASCADE, 0, 0);
  446.                break;
  447.  
  448.             case IDM_WINDOWARRANGEICONS:
  449.                
  450.                SendMessage(g_hWndMDITClient, WM_MDIICONARRANGE, 0, 0);
  451.                break;
  452.  
  453.             default:
  454.                
  455.                SendMessage(hWndActiveMDITChild, wMsg, wParam, lParam);
  456.                break;
  457.          }
  458.          break;
  459.  
  460.       default:
  461.          fCallDefProc = TRUE;
  462.          break;
  463.    }
  464.  
  465.    if (fCallDefProc)
  466.       dwResult = DefFrameProc(hWnd, g_hWndMDITClient, wMsg, wParam, lParam);
  467.  
  468.    return(dwResult);
  469. }
  470.  
  471. BOOL FAR PASCAL RegisterFrameWndClass (void) 
  472. {
  473.    WNDCLASS wc;
  474.  
  475.    wc.style          = CS_HREDRAW | CS_VREDRAW;
  476.    wc.lpfnWndProc    = FrameWndProc;
  477.    wc.cbClsExtra     = sizeof(CLSEB);
  478.    wc.cbWndExtra     = 0;
  479.    wc.hInstance      = g_hInstance;
  480.    wc.hIcon          = LoadIcon(g_hInstance, _szClassName);
  481.    wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
  482.    wc.hbrBackground  = COLOR_WINDOW + 1;
  483.    wc.lpszMenuName   = _szClassName;
  484.    wc.lpszClassName  = _szClassName;
  485.    return(RegisterClass(&wc));
  486. }
  487.  
  488. void NEAR PASCAL TileVertically (HWND hWndMDITClient) 
  489. {
  490.    int nNumWndsOnRow, nOpenMDITChildren = 0, nTopOfBottomIconRow = 0;
  491.    int nCrntCol, nColWidth, nCrntRow, nNumRows, nRowHeight, nMinWndHeight;
  492.    HWND hWndChild;
  493.    HANDLE hWinPosInfo;
  494.    RECT rc;
  495.    POINT Point;
  496.    DWORD dwChildInfo;
  497.    
  498.    ShowScrollBar(hWndMDITClient, SB_BOTH, 0);
  499.    
  500.    SendMessage(hWndMDITClient, WM_MDIICONARRANGE, 0, 0);
  501.    
  502.    hWndChild = GetWindow(hWndMDITClient, GW_CHILD);
  503.    do 
  504.    {
  505.       if (IsIconic(hWndChild) && GetWindow(hWndChild, GW_OWNER) == NULL) 
  506.       {
  507.          GetWindowRect(hWndChild, &rc);
  508.          nTopOfBottomIconRow = max(nTopOfBottomIconRow, rc.top);
  509.       }
  510.  
  511.       if (!IsIconic(hWndChild) && GetWindow(hWndChild, GW_OWNER) == NULL)
  512.          ++nOpenMDITChildren;
  513.  
  514.     } while ((hWndChild = GetWindow(hWndChild, GW_HWNDNEXT)) != NULL);
  515.    
  516.    if (nOpenMDITChildren == 0) 
  517.          return;
  518.    
  519.    GetClientRect(hWndMDITClient, &rc);
  520.  
  521.    if (nTopOfBottomIconRow) 
  522.    {
  523.       Point.x = 0; Point.y = nTopOfBottomIconRow;
  524.       ScreenToClient(hWndMDITClient, &Point);
  525.       rc.bottom = Point.y;
  526.    }
  527.    
  528.    dwChildInfo = SendMessage(hWndMDITClient, WM_MDIGETACTIVE, 0, 0);
  529.    if (HIWORD(dwChildInfo) == 1)
  530.       ShowWindow(LOWORD(dwChildInfo), SW_RESTORE);
  531.    
  532.    nMinWndHeight = max(1, rc.bottom / (5 * GetSystemMetrics(SM_CYCAPTION)));
  533.    nNumRows = min(nOpenMDITChildren, nMinWndHeight);
  534.    nRowHeight = rc.bottom / nNumRows;
  535.    hWndChild = GetWindow(hWndMDITClient, GW_CHILD);
  536.    hWinPosInfo = BeginDeferWindowPos(nOpenMDITChildren);
  537.    
  538.    for (nCrntRow = 0; nCrntRow < nNumRows; nCrntRow++) 
  539.    {
  540.       nNumWndsOnRow = nOpenMDITChildren / nNumRows +
  541.          ((nOpenMDITChildren % nNumRows > (nNumRows - (nCrntRow + 1))) ? 1 : 0);
  542.       
  543.       nColWidth = rc.right / nNumWndsOnRow;
  544.       
  545.       for (nCrntCol = 0; nCrntCol < nNumWndsOnRow; ) 
  546.       {
  547.          if (!IsIconic(hWndChild) && GetWindow(hWndChild, GW_OWNER) == NULL)
  548.          {
  549.             hWinPosInfo = DeferWindowPos(hWinPosInfo, hWndChild, NULL,
  550.                nCrntCol * nColWidth, nCrntRow * nRowHeight, nColWidth,
  551.                nRowHeight, SWP_NOACTIVATE | SWP_NOZORDER);
  552.             
  553.             nCrntCol++;
  554.          }
  555.          
  556.          hWndChild = GetWindow(hWndChild, GW_HWNDNEXT);
  557.       }
  558.    }
  559.    
  560.    EndDeferWindowPos(hWinPosInfo);
  561. }
  562.